<template>
  <div class="home" style="margin: 0px 15px;background: #fdfcfc">
    <div id="top">
     <br><br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span  style="font-size: 15px;">财务一览
      </span><br><br>
      <div>
        <!--块类统计-->
        <el-row :gutter="20">
          <el-col :span="8">
            <el-card class="box-card" style="border-radius: 15px;background: #f5f4f4">
              <span style="font-size: 15px"> <i class="el-icon-s-shop" style="color: purple;font-size: 15px"></i>总营业额</span><br><br>
              <hr>
              <br>
              <div>
                <span style="font-size: 15px">已结算/总额</span>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <span style="font-size: 15px">{{this.Tcustomer}}/30000</span><br>
                <el-progress  :percentage="20" style="display: inline-block;width: 100%"></el-progress>
              </div>
            </el-card>
          </el-col>
          <el-col :span="8">
            <el-card class="box-card" style="border-radius: 15px;background: #f5f4f4">
              <span style="font-size: 15px">  <i class="el-icon-user-solid" style="color: green"></i>可提现金额</span><br><br>
              <hr>
              <br>
              <div>
                <span style="font-size: 15px">已提现/总额</span>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <span style="font-size: 15px">{{consumeMoney}}/30000</span><br>
                <el-progress  :percentage="20" style="display: inline-block;width: 100%"></el-progress>
              </div>
            </el-card>
          </el-col>
          <el-col :span="8">
            <el-card class="box-card" style="border-radius: 15px;background: #f5f4f4">
              <span style="font-size: 15px">   <i class="el-icon-s-finance" style="color: red"></i>客户钱包余额</span><br><br>
              <hr>
              <br>
              <div>
                <span style="font-size: 15px">已提现/总额</span>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <span style="font-size: 15px;">{{consumeMoney}}/30000</span><br>
                <el-progress  :percentage="20" style="display: inline-block;width: 100%"></el-progress>
              </div>
            </el-card>
          </el-col>
        </el-row>
      </div>
    </div>
    <!--  财务管理首页-->
    <br><br>
    <el-tabs type="card">

      <el-tab-pane  label="提现管理">
        <el-dialog
          title="公司余额提现"
          :visible.sync="dialogVisible3"
          width="30%"
          :before-close="handleClose">
          <el-form
            label-width="150px"
            style="max-width: 460px;font-size: 10px"
          >
            <el-form-item label="提现金额">
              <el-input-number v-model="num" controls-position="right" @change="handleChange" :min="1000" :max="1000000" :step="500">可以</el-input-number>
            </el-form-item>
            <el-form-item label="提现账号:">
              <el-input v-model="bankAccount"/>
            </el-form-item>
            <el-form-item label="手续费:">
              <span>0.6% <span style="color:chartreuse">(提现金额扣除体现手续费后为实际到账金额)</span></span>
            </el-form-item>

          </el-form>
          <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible3 = false">取 消</el-button>
    <el-button type="primary" @click="wcb">提 现</el-button>
  </span>
        </el-dialog>







        <el-dialog
          :visible.sync="dialogVisible5"
          width="25%"
          :before-close="handleClose">
          <span style="font-size:25px;">提现详情</span>
          <span v-model="withdrawa.status" style="margin-left: 10px">
                            <el-tag  type="success" v-if="withdrawa.status===1">已打款</el-tag>
                            <el-tag  v-if="withdrawa.status===2">待审核</el-tag>
                            <el-tag type="danger" v-if="withdrawa.status===3">已拒绝</el-tag>
                    </span><br><br>
          <span style="font-size: 20px">待结算金额:</span> <span style=" margin-left:30%;font-size: 10px;color: chartreuse ">{{withdrawa.withdrawTime}}</span><br>
          <span style="color: blue;font-size: 20px">￥{{withdrawa.money}}&nbsp;&nbsp;<span style="font-size: 8px;color:red">￥函{{withdrawa.serviceMoney}}手续费</span></span>
          <span slot="footer" class="dialog-footer">
                    </span>
          <span slot="footer" class="dialog-footer">
                            <el-form
                              label-width="150px"
                              style="max-width: 460px;font-size: 10px"
                            >
                        <el-form-item label="申请人:">
                            <el-input disabled
                                      v-model="withdrawa.customerName">
                            </el-input>
                        </el-form-item>
                                        <el-form-item label="所属公司:">
                            <el-input disabled
                                      v-model="withdrawa.orgName"
                            >
                            </el-input>
                        </el-form-item>
                                        <el-form-item label="审核人:">
                            <el-input disabled
                                      v-model="withdrawa.authorName">
                            </el-input>
                        </el-form-item>
                                        <el-form-item label="银行名称:">
                            <el-input disabled
                                      v-model="withdrawa.bankName">
                            </el-input>
                        </el-form-item>
                                <el-form-item label="银行卡号:">
                            <el-input disabled
                                      v-model="withdrawa.bankAccount">
                            </el-input>

                        </el-form-item>
                                        <el-form-item label="开户人名称:">
                            <el-input disabled
                                      v-model="withdrawa.accountName">
                            </el-input>
                        </el-form-item>
                         <el-form-item label="开户人手机号:">
                            <el-input  disabled
                                       v-model="withdrawa.accountPhone">
                            </el-input>
                        </el-form-item>

                         <el-form-item label="审核备注:" v-if="withdrawa.status===3">
                            <el-input  disabled
                                       v-model="withdrawa.remark">
                            </el-input>
                        </el-form-item>

                    </el-form>
    <el-button @click="dialogVisible6 = true">拒 绝</el-button>
    <el-button type="primary" @click="eft">通过</el-button>
  </span>
        </el-dialog>



        <el-dialog
          title="审核拒绝"
          :visible.sync="dialogVisible6"
          width="25%"
          :before-close="handleClose">
          <span>审核备注:</span>
          <el-input
            type="textarea"
            :rows="2"
            v-model="withdrawa.remark"
            placeholder="请输入备注类容..."
          >
          </el-input>
          <el-button @click="refuse">拒 绝</el-button>
          <el-button type="primary" @click="dialogVisible6 = false">通 过</el-button>

        </el-dialog>

        &nbsp;&nbsp;&nbsp;<el-link :underline="false" v-model="selectAll"  @click="QueryWithdrawal()">全部({{selectAll}})</el-link>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <el-link :underline="false" v-model="WaitingAudit"  @click="QueryWithdrawal(2)">待审核 ({{WaitingAudit}})</el-link>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <el-link :underline="false" v-model="RemittedMoney" @click="QueryWithdrawal(1)">已打款 ({{RemittedMoney}})</el-link>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <el-link :underline="false" v-model="Declined"  @click="QueryWithdrawal(3)">已拒绝 ({{Declined}})</el-link>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;




        <el-input
          type="text"
          prefix-icon="el-icon-search"
          placeholder="搜索...."
          style="width: 270px; cursor: pointer;margin-left: 150px"
          @keyup.enter.native="getTime(1)"
          v-model="orgName"
        ></el-input>
        &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;
        <el-select v-model="time1" clearable placeholder="请选择"  @change="getTime(1)">
          <el-option
            v-for="item in createTime"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>&nbsp;
        &nbsp;&nbsp;

        <el-button type="primary" @click="dialogVisible3=true">公司余额提现</el-button>



        <template>
          <el-table
            :data="WithdrawalDetails"
            style="width: 100%">
            <el-table-column  label="申请人图片">
              <el-avatar  src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"></el-avatar>
            </el-table-column>

            <el-table-column  prop="customerName" label="申请人"/>
            <el-table-column prop="orgName" label="所属公司"  />
            <el-table-column prop="money" label="提现金额"  />
            <el-table-column prop="serviceMoney" label="手续费"  />
            <el-table-column prop="status" label="状态">
              <template #default="scope">
                <el-tag  type="success"  v-if="scope.row.status===1">已打款</el-tag>
                <el-tag  v-if="scope.row.status===2">待审核</el-tag>
                <el-tag type="danger" v-if="scope.row.status===3">已拒绝</el-tag>
              </template>
            </el-table-column>
            <el-table-column prop="authorName" label="审核人"  />
            <el-table-column prop="withdrawTime" label="申请时间"  />
            <el-table-column label="操作" width="235">
              <template #default="scope" >
                <el-button size="small" type="text"  v-if="scope.row.status ===1||scope.row.status===2||scope.row.status===3"
                           @click="Modificat(scope.row)">详情</el-button>
                <el-button size="small" type="text" @click="Modifi(scope.row)" v-if="scope.row.status ===2">通过</el-button>
                <el-button size="small" type="text" @click="Mod(scope.row)" v-if="scope.row.status ===2">拒绝</el-button>
              </template>



            </el-table-column>
          </el-table>
        </template>

        <el-footer style="position: relative;margin:0 auto;text-align: center">
          <el-pagination background
                         layout="prev, pager, next,jumper"
                         :total="total2"
                         :page-sizes="[1,2,3,4,5]"
                         :page-size="pages1"
                         @current-change="getTime"
          />
        </el-footer>
      </el-tab-pane>






      <el-tab-pane label="支付流水">


        <el-input
          type="text"
          prefix-icon="el-icon-search"
          placeholder="搜索...."
          style="width: 270px; cursor: pointer"
          @keyup.enter.native="PagingQueryPayment(1)"
          v-model="customerName"

        ></el-input>&nbsp;&nbsp;
        <el-select   v-model="categoryName1" clearable class="m-2" placeholder="明细类型   全部" @change="PagingQueryPayment(1)" >
          <el-option
             v-for="itme in categoryName"
             :label="itme.label"
             :key="itme.value"
             :value="itme.value"
          >
          </el-option>
        </el-select> &nbsp;&nbsp;
        <el-select v-model="title1" clearable placeholder="交易方式   全部"    @change="PagingQueryPayment(1)">
          <el-option
            v-for="itm in title"
            :label="itm.label"
            :key="itm.value"
            :value="itm.value"
          />
        </el-select> &nbsp;&nbsp;
        <el-select v-model="time1"  clearable placeholder="请选择"  @change="PagingQueryPayment(1)">
          <el-option
            v-for="item in createTime"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <el-button type="primary"  >流水统计</el-button>
        <template>
          <el-table
            :data="CustomerBill"
            style="width: 100%">
            <el-table-column prop="userName" label="会员昵称" />
            <el-table-column prop="customerName" label="客户昵称"  />
            <el-table-column prop="categoryName" label="明细类型"  />
            <el-table-column prop="title" label="充值方式"  />
             <el-table-column prop="money" label="金额">
               <template #default="scope">
                 <el-tag>{{scope.row.money}}</el-tag>
               </template>
             </el-table-column>

            <el-table-column prop="givePrice" label="赠送金额" >
              <template #default="scope">
                <el-tag type="danger">{{scope.row.givePrice}}</el-tag>
              </template>
            </el-table-column>
            <el-table-column prop="createTime" label="创建时间"  />
          </el-table>
        </template>


        <el-footer style="position: relative;margin:0 auto;text-align: center">
          <el-pagination background
                         layout="prev, pager, next,jumper"
                         :total="total"
                         :page-sizes="[1,2,3,4,5]"
                         :page-size="pages"
                         @current-change="PagingQueryPayment"
          />
        </el-footer>


      </el-tab-pane>

      <el-tab-pane label="充值管理">

        <el-input v-model="exchargeName" placeholder="搜索..." suffix-icon="el-icon-search" style="width: 200px;"
                  @change="selectExchargePackage"></el-input>

        <el-select v-model="receiveEndTime" clearable placeholder="时间范围" style="margin-left: 5px" @change="selectExchargePackage()">
          <el-option
            v-for="item in dates"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>

        <el-button type="primary" @click="dialogFormVisible=true">创建充值包</el-button>
        <br><br><br>


        <div v-for="item in exchargePackage" border style="
        width: 350px;display:inline-block;float: left;
                             -moz-border-radius: 10px;
                         -webkit-border-radius: 15px;
                                 border-radius: 15px;
                              background-color: rgb(238,238,238);
                                   margin-left: 15px;
                                   margin-top: 15px;
                                ">
          <br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id="h1">{{item.exchargeName}}</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <hr style="height:1px;border:none;border-top:1px solid rgba(0,0,0,0.2)">
         <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <span class="l">充值金额：  {{item.exchargeMoney}}元</span><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <span class="l">赠优惠券：  <span><el-tag  type="warning">{{item.couponMoney}}</el-tag></span>x<span>{{item.couponNum}}</span></span><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <span class="l">活动时间：  {{item.receiveStartTime}}-{{item.receiveEndTime}}</span><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <span class="l">使用门槛：  {{item.remark}}</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        </div>


        <el-dialog title="创建充值包" :visible.sync="dialogFormVisible"
                   :before-close="handleClose"
                   width="30%">
          <el-form :model="form" ref="package" size="mini"   label-width="150px"
                   style="max-width: 460px;font-size: 10px">
            <el-form-item label="充值包名称" prop="exchargeName" >
              <el-input v-model="form.exchargeName"></el-input>
            </el-form-item>
            <el-form-item label="充值金额" prop="exchargeMoney">
              <el-input-number v-model="form.exchargeMoney" controls-position="right" @change="handleChange" :min="1" :step="10" :max="1000000"></el-input-number>
            </el-form-item>
            <el-form-item label="赠送优惠劵金额" prop="couponMoney">
              <el-input-number v-model="form.couponMoney" controls-position="right" @change="handleChange" :min="1" :step="10" :max="1000000"></el-input-number>
            </el-form-item>
            <el-form-item label="赠送优惠劵数量" prop="couponNum">
              <el-input-number v-model="form.couponNum" controls-position="right" @change="handleChange" :min="1" :step="10" :max="100000"></el-input-number>
            </el-form-item>
            <el-form-item label="使用门槛" prop="remark">
              <el-input v-model="form.remark"></el-input>
            </el-form-item>
            <el-form-item label="活动时间" prop="activeTime" >
              <el-date-picker
                v-model="activeTime"
                type="daterange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                format="yyyy-MM-dd HH:mm:ss"
                value-format="yyyy-MM-dd HH:mm:ss"
              >
              </el-date-picker>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="add">取 消</el-button>
            <el-button type="primary" @click="save">创 建</el-button>
          </div>
        </el-dialog>

      </el-tab-pane>
    </el-tabs>

  </div>
</template>

<script>
  import axios from '@/utils/request'
  import Index from "@/views/store/sort/index";
  export default {
    name: 'HelloWorld',
    components: {Index},
    data(){
      return {
        dialogVisible1: false,
        dialogVisible: false,
        dialogVisible3: false,
        dialogVisible2: false,
        dialogVisible4: false,
        dialogVisible5: false,
        dialogVisible6: false,
        num:'',
        bankAccount:"",

        num2: 3,
        value1: '',
        value2: '',
        value3: '',
        remark1: '',




        pages:0,          //当前页的数量
        total:0,          //总记录数
        pageNum:1,
        CustomerBill:[],


        pages1:0,          //当前页的数量
        total2:0,          //总记录数
        pageNum3:1,


        WithdrawalStatus: '',

        //提现管理数据
        selectAll: "",
        RemittedMoney: "",
        WaitingAudit: "",
        Declined: "",
        WithdrawalDetails: [],
        WithdrawalDetails1: {},
        withdrawa: {},

        orgName: "",

        Tcustomer:'',


        createTime:[{
          value:7,
          label:"一周内"
        },{
          value: 31,
          label: "一个月内"
        },{
          value: 180,
          label: "半年内"
        }
        ],
        pageUtil:{},

       //下拉框
        time1:'',
        time2:'',//时间




        //支付流水
        categoryName1:"",
        title1:"",
        customerName:"",
       //下拉框
        categoryName:[{
          value:1,
          label:"充值"
        },{
          value: 4,
          label: "退款"
        },{
          value: 3,
          label: "余额付款"
        }
        ],


        //下拉框
        title:[{
          value:0,
          label:"支出"
        },{
          value: 1,
          label: "收款"
        },
        ],





        //充值包对象数组
        exchargePackage:[],
        //充值包名字
        exchargeName:'',
        receiveEndTime:'',

        dates: [{
          value: 7,
          label: '近一周'
        }, {
          value: 31,
          label: '近一月'
        },
          {
            value: 180,
            label: '近半年'
          }],

        dialogFormVisible: false,
        form: {
          exchargeName: '',
          exchargeMoney: '',
          couponMoney: '',
          couponNum: '',
          remark:'',
          receiveStartTime: '',
          receiveEndTime: ''
        },
        //活动时间
        activeTime:'',

        consumeMoney:'',

    }

    },methods: {

      customer(){
        axios.post("http://127.0.0.1/t_customer/turnoverSum").then(res=>{
          this.Tcustomer=res;
        })
      },
      customerSum(){
        axios.post("http://127.0.0.1/t_customer/balanceSum").then(res=>{
          this.consumeMoney=res;
        })
      },



      wcb(){
        let money = this.num-(this.num*0.6);
        let tWithdrawalDetails1 ={
          money : money,
          bankAccount : this.bankAccount
        }
        alert(money+this.bankAccount);
        axios.put("http://127.0.0.1/TStoreCoupon/wcb",tWithdrawalDetails1).then(res=>{
          alert("公司余额提现成功");
          this.dialogVisible3 = false;
        })
      },

      eft(){
        let tWithdrawalDetails=this.withdrawa
        console.log(this.withdrawa);
        axios.put("http://127.0.0.1/TStoreCoupon/Etf",tWithdrawalDetails).then(res=>{
          alert("转账成功")
          this.getTime(1)
          this.information();
          this.QueryWithdrawal();
          this.dialogVisible5=false;
        })
      },

      getTime(index) {
        let time11 = ""
        //创建date对象
        if (this.time1 != null && this.time1 != ''){
          const date = new Date();
          date.setTime(date.getTime() - 3600 * 1000 * 24 * this.time1);
          let year = date.getFullYear();
          let month = date.getMonth()+1;
          let day = date.getDate();
          if (day<10){
            day = "0"+day;
          }
          time11 = year+"-0"+month+"-"+day
        }
        axios.get("http://127.0.0.1/TStoreCoupon/tWithdrawalDetails",{params:{
            index:index,
            withdrawTime:time11,
            orgName: this.orgName,
          }}).then(res=>{
          this.WithdrawalDetails=res.list;
          this.pages1=res.pageSize;
          this.total2=res.total;
          this.pageNum3=res.pageNum;
        })
      },


      refuse(){
        this.dialogVisible6 = true;
        let withdrawalDetails = {
          id:this.withdrawa.id,
          status:this.withdrawa.status,
          remark:this.withdrawa.remark,
        };
        console.log(withdrawalDetails)
        axios.put("http://127.0.0.1/TStoreCoupon/Refuse",withdrawalDetails).then(res=>{
            alert("申请已拒绝！");
            this.QueryWithdrawal();
            this.dialogVisible5=false;
            this.dialogVisible6 = false;
        }).catch(function (error) {
          alert(error)
        })
      },
      PagingQueryPayment(e){
        let time11 = ""
        //创建date对象
        if (this.time1 != null && this.time1 != ''){
          const date = new Date();
          date.setTime(date.getTime() - 3600 * 1000 * 24 * this.time1);
          let year = date.getFullYear();
          let month = date.getMonth()+1;
          let day = date.getDate();
          if (day<10){
            day = "0"+day;
          }
          time11 = year+"-0"+month+"-"+day
        }
        this.pageNum=e
        axios.get("http://127.0.0.1/TStoreCoupon/tCustomerBill",{params:{
            index:this.pageNum,
            categoryId:this.categoryName1,
            pm:this.title1,
            customerName:this.customerName,
            createTime:time11,
          }})
          .then(response => {
            this.CustomerBill=response.list;
            this.pages=response.pageSize;
            this.total=response.total;
            this.pageNum=response.pageNum;
          }).catch(function (error) {
          alert(error);
        });
      },
      // 查询提现
      QueryWithdrawal(sta){
        this.WithdrawalStatus=sta
        axios.get("http://127.0.0.1/TStoreCoupon/WithdrawalDetails",{params:{
            status:this.WithdrawalStatus
          }})
          .then(response => {
            this.WithdrawalDetails=response;
            this.information();
          }).catch(function (error) {
          alert(error);
        });
      },
      //查看待审核
      information(){
        axios.get("http://127.0.0.1/TStoreCoupon/information")
          .then(response => {
            this.WithdrawalDetails1=response
            this.selectAll=response.selectAll
            this.RemittedMoney=response.remittedMoney
            this.WaitingAudit=response.waitingAudit
            this.Declined=response.declined

          }).catch(function (error) {
          alert(error);
        });
      },


      //查看详情
      Modificat(row){
        this.dialogVisible5=true;
        this.withdrawa=row;
      },
      //查看
      Modifi(row){
        this.withdrawa=row;
        this.eft();
      },


      Mod(row){
        this.dialogVisible6=true;
        this.withdrawa=row;
      },
      handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});
      },
      handleChange(value) {
        console.log(value);
      },


      clearable(){
        this.date=null;
      },




      //根据条件查询充值包
      selectExchargePackage(){
          let time11 = ""
          //创建date对象
          if (this.receiveEndTime != null && this.receiveEndTime != ''){
            const date = new Date();
            date.setTime(date.getTime() - 3600 * 1000 * 24 * this.receiveEndTime);
            let year = date.getFullYear();
            let month = date.getMonth()+1;
            let day = date.getDate();
            if (day<10){
              day = "0"+day;
            }
            time11 = year+"-0"+month+"-"+day
          }
          axios.get("http://127.0.0.1/aaa/list",{params:{
              exchargeName:this.exchargeName,
              receiveEndTime:time11
            }}).then(res=>{
            this.exchargePackage=res;
          })
      },

      //打开弹窗，并将弹窗中的数据清空
      add(){
        this.form.exchargeName =null;
        this.form.exchargeMoney =null;
        this.form.couponMoney =null;
        this.form.couponNum =null;
        this.form.remark =null;
        this.activeTime = null;
        this.dialogFormVisible=false;
      },
      //创建充值包
      save(){
        this.splitTime();
        axios.post("http://127.0.0.1/aaa/save",this.form).then(res=>{
          alert("创建优惠包成功")
            this.dialogFormVisible=false
            this.selectExchargePackage()
        })
      },
      splitTime(){
        this.form.receiveStartTime = this.activeTime[0]
        this.form.receiveEndTime=this.activeTime[1]
      }

    },mounted() {
      this.selectExchargePackage();
      this.getTime(1);
      this.information();
      this.PagingQueryPayment(1);
      this.customer();
      this.customerSum();
    }
  }
</script>

<style>
  .l{
    font-size: 18px;
  }

  #h1{
    font-size: 25px ;
  }
</style>
